home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 October: Mac OS SDK / Dev.CD Oct 96 SDK / Dev.CD Oct 96 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODF & Cyberdog / CyberStarter / Sources / Part.h < prev    next >
Encoding:
Text File  |  1996-08-16  |  2.4 KB  |  74 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                Part.h
  4. //    Release Version:    $ ODF 1 $
  5. //
  6. //    Copyright:            (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef PART_H
  11. #define PART_H
  12.  
  13. // Cyberdog 1.0b3 does not work properly when you call it from threads it did not
  14. // create. Since this is required for our blocking synchronous input code, we can
  15. // not use it until we get a newer Cyberdog. We'll be forced to use idle-time
  16. // input instead, which is clumsier and undesirable in general.
  17. #define USETHREADSFLAG    0
  18.  
  19. #include "FWPart.h"
  20. #include "FWCyPart.h"
  21. #if !USETHREADSFLAG
  22. #include "FWIdle.h"
  23. #include "FWCyStrm.h"
  24. #endif
  25.  
  26. class FW_CPresentation;
  27. class ODFrame;
  28.  
  29. //========================================================================================
  30. //    CLASS CPart
  31. //========================================================================================
  32.  
  33. class CPart: public FW_CPart, public FW_MCyberPart
  34. #if !USETHREADSFLAG
  35.     , public FW_CIdler
  36. #endif
  37. {
  38. public:
  39.     FW_DECLARE_AUTO(CPart)
  40.                     CPart (ODPart* odPart);
  41.                     ~CPart ();
  42.     void             Initialize (Environment* ev);
  43.     FW_CContent*     NewPartContent (Environment* ev);
  44.     FW_CFrame*         NewFrame (Environment* ev, ODFrame* odFrame, 
  45.                         FW_CPresentation* presentation, FW_Boolean fromStorage);
  46.     
  47.     void             ExternalizeContent (Environment* ev, ODStorageUnit* storageUnit, FW_CCloneInfo* cloneInfo);
  48.     void             InternalizeContent (Environment* ev, ODStorageUnit* storageUnit, FW_CCloneInfo* cloneInfo);
  49.     
  50.     // CYBERDOG
  51.     FW_CEventDispatcher* PrivNewEventDispatcher(Environment *ev);
  52.     void             DoSetCyberItem        (Environment* ev, CyberItem* newItem, ParameterSet* parameters);
  53.     void             HandleOpenCyberItem (Environment* ev, CyberItem* item, ODPart* openerPart, ParameterSet* how);
  54. #if !USETHREADSFLAG
  55.     // Read the data by polling during idles. Requires us to keep state (not
  56.     // much - only the CyberStream*).
  57.     FW_Boolean         DoIdle (Environment* ev, const FW_CNullEvent& event);
  58.     FW_CCyberStream fStream;
  59. #else
  60.     // Read the data in a thread.
  61.     static pascal void* LoadCyberItem (void* self_CPart);
  62. #endif
  63.     
  64.     // CONTENTDATA. A real part with more complex data would probably use a content
  65.     // model object and have accessors and the like. A simple text viewer doesn't
  66.     // need that.
  67.     Handle             fDownloadedText;
  68. private:
  69.     FW_CPresentation* fPresentation;
  70. };
  71.  
  72. #endif // PART_H
  73.  
  74.